package cn.wd.user.controller;


import cn.wd.common.vo.R;
import cn.wd.user.service.IStatisticService;
import cn.wd.user.vo.JsonResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/statistic")
public class StatisticController {

    private final IStatisticService statisticService;

    public StatisticController(IStatisticService statisticService) {
        this.statisticService = statisticService;
    }

    // 今日注册
    @RequestMapping("/registerToday")
    public JsonResult<Integer> registerToday (){
        return JsonResult.success(statisticService.selectRegisterToday());
    }

    // 今日弹幕
    @RequestMapping("/bulletMsgTody")
    public R<Integer> bulletMsgTody() {
        return R.OK(statisticService.selectBulletMsgTody());
    }

    // 今日举报
    @RequestMapping("/reportTody")
    public JsonResult<Integer> reportTody (){
        return JsonResult.success(statisticService.selectReportTody());
    }

    // 当前在线
    @RequestMapping("/currentOnline")
    public JsonResult<?> currentOnline(){
        int count = statisticService.selectCurrentOnline();
        return JsonResult.success(count);
    }

}